<?php
/**
 * Created by PhpStorm.
 * User: admin
 * Date: 2018/9/4
 * Time: 19:51
 */
require_once(LIB_PATH . 'sms/CCPRestSDK.php');
class mysms{
    public static $instant;
    public static function getInstant(){
        if(!self::$instant){
            self::$instant = new  REST(SMS_SERVER_IP, SMS_SERVER_PORT, SMS_SOFR_VERSION);
            self::$instant->setAccount(SMS_ACCOUNT_SID, SMS_ACCOUNT_TOKEN);
            self::$instant->setAppId(SMS_APP_ID);
        }

        return self::$instant;
    }


    public static function sendText($mobile,$params,$templateId){
        $instant = self::getInstant();
        return $instant->sendTemplateSMS($mobile, $params, $templateId);
    }

     public static function sendVoice($mobile,$params,$templateId){
        $instant = self::getInstant();
        return $instant->voiceVerify($mobile, $params, $templateId);
    }

}
